﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="http://schemas.panthernet.ru/graphx/">

    <!--  VERTEX CONTROL  -->
    <Style TargetType="{x:Type controls:VertexControl}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="VertexShape" Value="Circle" />
        <Setter Property="ShowLabel" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:VertexControl}">
                    <TextBlock Text="{Binding Vertex.Name, RelativeSource={RelativeSource TemplatedParent}}"
                               TextWrapping="Wrap"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

        <!--  VERTEX DRAGGING CONTROL  -->
        <Setter Property="controls:DragBehaviour.IsDragEnabled" Value="True" />
        <Setter Property="controls:DragBehaviour.UpdateEdgesOnMove" Value="True" />
    </Style>

    <!--  EDGE CONTROL  -->
    <Style TargetType="{x:Type controls:EdgeControl}">
        <Setter Property="SelfLoopIndicatorOffset" Value="10,10" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:EdgeControl}">
                    <Grid>
                        <Path x:Name="PART_edgePath"
                              Stroke="DarkGray"
                              StrokeThickness="3"
                              ToolTip="{TemplateBinding ToolTip}" />
                        <controls:DefaultEdgePointer x:Name="PART_EdgePointerForTarget"
                                                     NeedRotation="true">
                            <Path Width="15"
                                  Height="15"
                                  Data="M0,0.5 L1,1 1,0"
                                  Fill="Black"
                                  Stretch="Uniform" />
                        </controls:DefaultEdgePointer>
                        <Path x:Name="PART_SelfLoopedEdge"
                              Width="10"
                              Height="10"
                              Data="F1 M 17.4167,32.25L 32.9107,32.25L 38,18L 43.0893,32.25L 58.5833,32.25L 45.6798,41.4944L 51.4583,56L 38,48.0833L 26.125,56L 30.5979,41.7104L 17.4167,32.25 Z "
                              Fill="Black"
                              IsHitTestVisible="True"
                              Stretch="Uniform"
                              ToolTip="This vertex has some self looped edges!" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>